package com.basic.common.utils.smbUtils;

import jcifs.CIFSContext;

/**
 * 包装CIFSContext，并在使用完毕后自动将其返回给池中。
 */
public class CIFSContextWrapper implements AutoCloseable{

    private final CIFSContext context;

    public CIFSContextWrapper(CIFSContext context) {
        this.context = context;
    }

    public CIFSContext getContext() {
        return context;
    }

    @Override
    public void close() {
        CifsContextPoolUtils.returnContext(context);
    }

}
